package logic

import (
	"context"
	"zk2/common/proto/user"
	"zk2/rpc/server"
)

type UserRegister struct {
	user.UnimplementedUserServer
}

func (u UserRegister) Reg(ctx context.Context, in *user.RegRequest) (*user.RegResponse, error) {
	reg, err := server.Reg(in)
	if err != nil {
		return nil, err
	}
	return reg, nil
}

func (u UserRegister) Login(ctx context.Context, in *user.LoginRequest) (*user.LoginResponse, error) {
	login, err := server.Login(in)
	if err != nil {
		return nil, err
	}
	return login, nil
}
